home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Moscow ML 1.42 / src / mosmllib / CommandLine.sml < prev    next >
Encoding:
Text File  |  1997-08-18  |  383 b   |  17 lines  |  [TEXT/R*ch]

  1. (* CommandLine, 1997-03-07 *)
  2.  
  3. local 
  4.     prim_val argv_   : string Vector.vector = 0 "command_line";
  5. in
  6.  
  7. fun name () = 
  8.     if Vector.length argv_ > 0 then Vector.sub(argv_, 0) 
  9.     else raise Fail "failed in CommandLine.name"
  10.  
  11. fun arguments () = 
  12.     let fun h i res = 
  13.     if i >= 1 then h (i-1) (Vector.sub(argv_, i) :: res)
  14.     else res
  15.     in h (Vector.length argv_ - 1) [] end;
  16. end
  17.